<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="author" content="纪德朝">
    <title>练习</title>
    <style>
        div {
            width: 200px;
            /* height: 500px; */
            /* border: 2px solid red; */
            background-color: lightcyan;
            margin: 20px auto;
        }

        h1 {
            text-align: center;
        }

        ul {
            width: 180px;
            height: 150px;
            border: 1px solid black;
            margin: 0 auto;
            padding: 0;
            list-style: none;
            position: relative;
            overflow: hidden;
            margin-bottom: 10px;
        }

        ul>li {
            position: absolute;
        }

        .right {
            top: 0;
            left: 180px;
            /* opacity: 0; */
        }

        p {
            width: 100%;
            background-color: orange;
            position: absolute;
            text-indent: 1em;
        }

        .first {
            top: 115px;
            left: 0;
        }

        .second {
            top: 140px;
            left: 0;
        }
    </style>
</head>

<body>
    <h1>专辑推荐</h1>
    <div>
        <ul>
            <li class="left">
                <img src="./img/1_1.jpg" alt="">
            </li>
            <li class="right">
                <img src="./img/1_2.jpg" alt="">
            </li>
            <p class="first">COCOON/可可尼</p>
            <p class="second">几何为网-极致绚烂</p>
            li
        </ul>
        <ul>
            <li class="left">
                <img src="./img/2_1.jpg" alt="">
            </li>
            <li class="right">
                <img src="./img/2_2.jpg" alt="">
            </li>
            <p class="first">COCOON/可可尼</p>
            <p class="second">几何为网-极致绚烂</p>
        </ul>
        <ul>
            <li class="left">
                <img src="./img/3_1.jpg" alt="">
            </li>
            <li class="right">
                <img src="./img/3_2.jpg" alt="">
            </li>
            <p class="first">COCOON/可可尼</p>
            <p class="second">几何为网-极致绚烂</p>
        </ul>
    </div>
    <script src="./js/jquery.js"></script>
</body>
<script>
    $('ul').hover(function () {
        console.log(this);
        console.log($(this).index());
        $(this).find('.left').stop().animate({
            left: -170,
            // opacity:0
        }, 1000);
        $(this).find('.first').stop().animate({
            top: 130,
        }, 1000);

        $(this).find('.right').stop().animate({
            left: 0,
            // opacity:1
        }, 1000);
        $(this).find('.second').stop().animate({
            top: 115,
        }, 1000);
    }, function () {
        $(this).find('.left').stop().animate({
            left: 0,
            // opacity:1
        }, 1000);
        $(this).find('.first').stop().animate({
            top: 115,
        }, 1000);

        $(this).find('.right').stop().animate({
            left: 180,
            // opacity:0
        }, 1000);
        $(this).find('.second').stop().animate({
            top: 140,
        }, 1000);
    })

</script>

</html>